{% extends "base_ext.html" %}

{% load crispy_forms_tags %}
{% load el_pagination_tags %}
{% load lbworkflow_tags %}

{% block nav_sel_node %}id-nav-mywf{% endblock %}

{% block right_side %}
  <section class="content-header">
    {% include "incs/messages.html" %}
    <div class="right-btns">
        <a href="{% url 'wf_start_wf' %}">Submit a new workflow</a>
    </div>
    <h1>
        I submitted
    </h1>
  </section>
  <section class="content">
    <div class="box">
      {% if search_form %}
        <div class="box-header">
          <div class="input-group">
            {% crispy search_form %}
          </div>
        </div>
      {% endif %}
      <div class="box-body table-responsive no-padding">
        <table class="table table-hover">
          <tbody>
            <tr>
              <th>NO.</th>
              <th>Process name</th>
              <th>Summary</th>
              <th>Created on</th>
              <th>Current operator</th>
              <th>Node</th>
            </tr>
            {% paginate object_list %}
            {% for pi in object_list %}
              <tr>
                <td><a href="{% url 'wf_detail' pi.pk %}">{{ pi.no }}</a></td>
                <td>{{ pi.process.name }}</td>
                <td>{{ pi.summary }}</td>
                <td>{{ pi.created_on|date:"Y-m-d H:i" }}</td>
                <td>{{ pi.get_operators_display }}</td>
                <td>
                  <span class="label label-{{ pi|flow_status_css_class }}">
                    {{ pi.cur_node.name }}
                  </span>
                </td>
              </tr>
            {% endfor %}
          </tbody>
        </table>
      </div>
      <div class="box-footer clearfix">
        {% show_pages %}
      </div>
    </div>
  </section>
{% endblock %}